import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ExcelTableComponent } from './components/excel-table/excel-table.component';
import { LoginComponent } from './components/login/login.component';
import { MainPageComponent } from './components/main-page/main-page.component';
import { UserInfoComponent } from './components/user-info/user-info.component';

const routes: Routes = [
  { path: 'login', component: LoginComponent },
  {
    path: 'mainpage', component: MainPageComponent,
    children: [
      { path: 'userInfo', component: UserInfoComponent },
      { path: 'excelTable', component: ExcelTableComponent },
    ]
  },
  { path: '**', redirectTo: '/login', pathMatch: 'full' }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
